//
//  mGiftOrderResult.swift
//  ShopIOS
//
//  Created by Apple on 2019/8/9.
//  Copyright © 2019 Apple. All rights reserved.
//

import Foundation
import SwiftyJSON
struct mGiftOrderResult {
    var Models = [mGiftOrderModels]()
    var Total: Int = 0
    
    init(json: JSON) {
        Models = json["Models"].arrayValue.compactMap({ mGiftOrderModels(json: $0)})
        Total = json["Total"].intValue
    }
}

struct mGiftOrderItems {
    var SaleIntegral: Int = 0
    var Quantity: Int = 0
    var DefaultImage: String?
    var OrderId: Int = 0
    var GiftId: Int = 0
    var GiftName: String?
    var ImagePath: String?
    var Id: Int = 0
    var GiftValue: Int = 0
    
    init(json: JSON) {
        SaleIntegral = json["SaleIntegral"].intValue
        Quantity = json["Quantity"].intValue
        DefaultImage = json["DefaultImage"].stringValue
        OrderId = json["OrderId"].intValue
        GiftId = json["GiftId"].intValue
        GiftName = json["GiftName"].stringValue
        ImagePath = json["ImagePath"].stringValue
        Id = json["Id"].intValue
        GiftValue = json["GiftValue"].intValue
    }
}

struct mGiftOrderModels {
    var ShipOrderNumber: String?
    var OrderStatus: Int = 0
    var CloseReason: String?
    var ExpressCompanyName: String?
    var Address: String?
    var UserName: String?
    var ShowExpressCompanyName: String?
    var ShippingDate: String?
    var UserRemark: String?
    var CellPhone: String?
    var ShipTo: String?
    var Id: Int = 0
    var FinishDate: String?
    var Items = [mGiftOrderItems]()
    var TopRegionId: Int = 0
    var UserId: Int = 0
    var ShowOrderStatus: String?
    var OrderDate: String?
    var TotalIntegral: Int = 0
    var RegionFullName: String?
    var RegionId: Int = 0
    
    init(json: JSON) {
        ShipOrderNumber = json["ShipOrderNumber"].stringValue
        OrderStatus = json["OrderStatus"].intValue
        CloseReason = json["CloseReason"].stringValue
        ExpressCompanyName = json["ExpressCompanyName"].stringValue
        Address = json["Address"].stringValue
        UserName = json["UserName"].stringValue
        ShowExpressCompanyName = json["ShowExpressCompanyName"].stringValue
        ShippingDate = json["ShippingDate"].stringValue
        UserRemark = json["UserRemark"].stringValue
        CellPhone = json["CellPhone"].stringValue
        ShipTo = json["ShipTo"].stringValue
        Id = json["Id"].intValue
        FinishDate = json["FinishDate"].stringValue
        Items = json["Items"].arrayValue.compactMap({ mGiftOrderItems(json: $0)})
        TopRegionId = json["TopRegionId"].intValue
        UserId = json["UserId"].intValue
        ShowOrderStatus = json["ShowOrderStatus"].stringValue
        OrderDate = json["OrderDate"].stringValue
        TotalIntegral = json["TotalIntegral"].intValue
        RegionFullName = json["RegionFullName"].stringValue
        RegionId = json["RegionId"].intValue
    }
}
